<!DOCTYPE html "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">


<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">产品名称：</label>
                            <div class="col-sm-10">
                                <input id="productName" name="productName" th:value="${product.productName}"
                                       class="form-control" type="text" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">产品描述：</label>
                            <div class="col-sm-10">
                                <input id="productTitle" name="productTitle" th:value="${product.productTitle}"
                                       class="form-control" type="text" readonly="readonly">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">产品类型：</label>
                            <div class="col-sm-4">
                                <select id="productType" name="productType"  th:field="${product.productType}"
                                        data-placeholder="产品类型" class="form-control chosen-select"
                                        onchange="changeProdType(this)" disabled="disabled">
                                    <option value="1">信用卡办理</option>
                                    <option value="2">芝麻分贷款</option>
                                </select>
                            </div>
                            <label id="lb_rate" class="col-sm-2 control-label" style="display: none">月利率(%)：</label>
                            <div id="div_rate"  class="col-sm-4" style="display: none">
                                <input type="number" id="monthRate" name="monthRate" th:value="${product.monthRate}"
                                       data-placeholder="月利率" class="form-control" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否置顶：</label>
                            <div class="col-sm-4">
                                <select id="isHot" name="isHot" th:field="${product.isHot}"
                                        data-placeholder="是否置顶" class="form-control chosen-select"  disabled="disabled"   >
                                    <option value="0">否</option>
                                    <option value="1">是</option>
                                </select>
                            </div>
                            <label class="col-sm-2 control-label">预设申请成功人数：</label>
                            <div class="col-sm-4">
                                <input type="number" id="succNum" name="succNum" th:value="${product.succNum}"
                                       data-placeholder="预设申请成功人数" class="form-control" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">产品图片：</label>
                        </div>

                        <div class="form-group" th:if="${product.productImg} != ''">
                            <div class="col-sm-8 col-sm-offset-3">
                                <img th:src="${product.productImg}"  alt="产品图片" class="img-responsive img-thumbnail"
                                     style="height: 60px;width: 60px">
                            </div>
                        </div>

                        <div class="form-group" id="cardDiv1">
                            <label class="col-sm-2 control-label">信用卡图片：</label>
                        </div>

                        <div class="form-group" id="cardDiv2" th:if="${product.cardImg} != ''">
                            <div class="col-sm-8 col-sm-offset-3">
                                <img th:src="${product.cardImg}" alt="信用卡图片" class="img-responsive img-thumbnail"
                                     style="height: 80px;width: 120px">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">邀请佣金：</label>
                            <div class="col-sm-4">
                                <input type="number" id="commission" name="commission" th:value="${product.commission}"
                                       data-placeholder="邀请佣金" class="form-control" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">产品申请页地址：</label>
                            <div class="col-sm-10">
                                <input id="regPageUrl" name="regPageUrl" th:value="${product.regPageUrl}" class="form-control"
                                       type="text" maxlength="200" placeholder="http://..."  readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">申请条件：</label>
                            <div class="col-sm-10">
                                <textarea id="regCondition" name="regCondition" th:text="${product.regCondition}"
                                          class="form-control" placeholder="申请条件..." readonly="readonly"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">产品详情说明：</label>
                            <div class="col-sm-10">
                                <textarea id="productDetail" name="productDetail" th:text="${product.productDetail}"
                                          class="form-control" placeholder="产品详情说明..." readonly="readonly"></textarea>
                            </div>
                        </div>

                        <!--<div class="form-group">-->
                            <!--<input id="productDetail" name="productDetail" th:value="${product.productDetail}"  type="hidden" class="form-control">-->
                            <!--<label class="col-sm-2 control-label">产品详情说明：</label>-->
                            <!--<div class="col-sm-10">-->
                                <!--<div class="ibox-content no-padding">-->
                                    <!--<div id="content_sn" class="summernote"></div>-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script th:inline="javascript">
    $().ready(function () {
        var productType = [[${product.productType}]];
        if(productType == "1"){
            $('#lb_rate').hide();
            $('#div_rate').hide();
            $('#cardDiv1').show();
            $('#cardDiv2').show();
        }else if(productType == "2"){
            $('#lb_rate').show();
            $('#div_rate').show();
            $('#cardDiv1').hide();
            $('#cardDiv2').hide();
        }

        console.log('isHot :'+isHot);
    });





</script>
</body>
</html>